package com.atguigu.edu.publisher.service.impl;

import com.atguigu.edu.publisher.beans.TradeSubjectOrderAmount;
import com.atguigu.edu.publisher.mapper.TradeStatsMapper;
import com.atguigu.edu.publisher.service.TradeStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * 交易域统计server接口实现类
 */
@Service
public class TradeStatsServiceImpl implements TradeStatsService {

    @Autowired
    private TradeStatsMapper tradeStatsMapper;


    @Override
    public BigDecimal getGMV(Integer date) {
        return tradeStatsMapper.selectGMV(date);
    }

    @Override
    public List<TradeSubjectOrderAmount> getSubjectAmount(Integer date,Integer limit) {
        return tradeStatsMapper.selectSubjectAmount(date,limit);
    }
}
